<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/11/28 0028
  Time: 15:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="jquery/jquery-3.0.0.min.js"></script>
    <script>
        $(function () {
            $(":input").keyup(function () {
                var data = $(this).val();
                $.ajax({
                    type:"get",
                    url:"${pageContext.request.contextPath}/aservlet",
                    data:"data="+data,
                    success:function (msg) {
                        var split = msg.split(";");
                        console.log(split)
                        $("select").empty();
                        // $("#d1").append("<option>"+msg+"</option>")
                        $.each(split,function (index,ele) {
                            $("#d1").append("<option>"+ele+"</option>")
                        })
                    }
                })
            })
        })
    </script>
</head>
<body>
<input type="text"> <select name="" id="d1"></select>
</body>
</html>
